# Makefile for Octave extension

OBJS = 	SerialPortMake.oct SerialPortOpen.oct SerialPortClose.oct SerialPortWrite.oct
CC = mkoctfile # Octave compiler command
LIBS = -lserial
CFLAGS = 

.phony: all      # .phony: targets which do not actually create file
all:	$(OBJS)

.phony: clean
clean:
	rm -f $(OBJS) *.o

.phony: disclean
disclean: clean
	rm -f *~ octave-core core

#.phony: test
#test: SerialPortMake.oct
#	echo "test SerialPortOct.cc" | octave --silent

SerialPortMake.oct: SerialPortOct.cc
	mkoctfile SerialPortOct.cc -o SerialPortMake.oct $(LIBS)

SerialPortOpen.oct: SerialPortMake.oct
	ln -s SerialPortMake.oct SerialPortOpen.oct

SerialPortClose.oct: SerialPortMake.oct
	ln -s SerialPortMake.oct SerialPortClose.oct

SerialPortWrite.oct: SerialPortMake.oct
	ln -s SerialPortMake.oct SerialPortWrite.oct